//
//  NYTopicVideoView.m
//  百思不得姐
//
//  Created by Apple on 15/8/24.
//  Copyright (c) 2015年 Neal. All rights reserved.
//

#import "NYTopicVideoView.h"
#import "NYTopicModel.h"
#import <UIImageView+WebCache.h>
#import "NYShowPictureViewController.h"
@interface NYTopicVideoView ()
@property (weak, nonatomic) IBOutlet UIButton *playButton;
@property (weak, nonatomic) IBOutlet UILabel *videoPlayCountLabel;
@property (weak, nonatomic) IBOutlet UILabel *videoPlayTimeLabel;

@end
@implementation NYTopicVideoView

- (void)setTopic:(NYTopicModel *)topic
{
    [super setTopic:topic];
    [_pictureView sd_setImageWithURL:[NSURL URLWithString:topic.smallimage]];
    
    if (topic.playcount>=10000) {
        CGFloat playcount = topic.playcount/10000.0;
        self.videoPlayCountLabel.text = [NSString stringWithFormat:@"%.1f万人播放",playcount];
    }else{
            self.videoPlayCountLabel.text = [NSString stringWithFormat:@"%ld人播放",topic.playcount];
    }

    self.videoPlayTimeLabel.text = [NSString stringWithFormat:@"%02ld:%02ld",topic.videotime/60,topic.videotime%60];
}

@end
